﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Entities.ThuQuy;
using DAL;
using BLToolkit.Mapping;
using BLToolkit.DataAccess;
using Entities.PBCM;


namespace Entities
{
    public class ChiTietHoaDon : BaseEntity<ChiTietHoaDon>
    {


        public string MaHD { get; set; }
        [PrimaryKey, Identity]
        public int MaCTHD { get; set; }
        public int LoaiChi { get; set; }
        public string VatPham { get; set; }
        public int SoLuong { get; set; }
        public float ThanhTien { get; set; }
        public string NoiDung { get; set; }
        [MapIgnore]
        public string TenLoaiChi { get{
            return LoaiChi == 1 ? "Thu" : "Chi";
        } }
        [MapIgnore]
        public string TenVatPham { get
            {
                ThietBi vp = ThietBi.Objects.GetById(VatPham);
                if (vp != null)
                    return vp.TenThietbi;
                else
                    return "";
        }
        }

        public HoaDon hoaDon;
    }
}
